package com.ly.anno;

import com.ly.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented //元注解
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
//指定提供校验规则的类
@Constraint(validatedBy = {StateValidation.class})

public @interface State {
    //用来提供检验失败的提示信息
    String message() default "state的参数的值只能是已发布或者草稿";
    //指定分组
    Class<?>[] groups() default {};
    //负载 获取State注解的附加信息
    Class<? extends Payload>[] payload() default {};
}
